﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TSVNAddin.Core
{
	public class SolutionActionExecutor : ISolutionEventListener
	{
		private readonly SolutionAdapter _SolutionAdapter;
		private readonly PathRenamedAction _PathRenamedAction;

		public SolutionActionExecutor(SolutionAdapter solutionAdapter, PathRenamedAction pathRenamedAction)
		{
			_SolutionAdapter = solutionAdapter;
			_PathRenamedAction = pathRenamedAction;
		}

		public void NotifyRenamed(string oldName)
		{
			string toPath = _SolutionAdapter.GetFileName();
			_PathRenamedAction.Execute(toPath, oldName);
		}
	}
}
